package com.zoweunion.mechanic.config.wx;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.io.InputStream;


/**
 * 微信支付参数
 *
 * @author zhangjun
 */
@Configuration
@ConfigurationProperties(prefix = "wx.wxpay")
public class WXPayConfig implements com.github.wxpay.sdk.WXPayConfig {
    /**
     * 异步接收微信支付结果通知的回调地址，通知url必须为外网可访问的url，不能携带参数。
     */
    public static final String NOTIFY_URL = "https://disapi.zoweunion.com/mechanic/onlinePay/wechatNotifyPay";
    //public static final String NOTIFY_URL = "https://zyhapi.mynatapp.cc/mechanic/onlinePay/wechatNotifyPay";
    /**
     * App ID
     */
    private String appID;
    /**
     * Mch ID
     */
    private String mchID;
    /**
     * API 密钥
     */
    private String key;
    /**
     * HTTP(S) 连接超时时间，单位毫秒
     */
    private Integer httpConnectTimeoutMs;
    /**
     * HTTP(S) 读数据超时时间，单位毫秒
     */
    private Integer httpReadTimeoutMs;
    /**
     * 商户证书内容
     */
    private InputStream certStream;

    @Override
    public String getAppID() {
        return appID;
    }

    @Override
    public String getMchID() {
        return mchID;
    }

    @Override
    public String getKey() {
        return key;
    }

    @Override
    public InputStream getCertStream() {
        return null;
    }

    @Override
    public int getHttpConnectTimeoutMs() {
        return httpConnectTimeoutMs;
    }

    @Override
    public int getHttpReadTimeoutMs() {
        return httpReadTimeoutMs;
    }

    public void setAppID(String appID) {
        this.appID = appID;
    }

    public void setMchID(String mchID) {
        this.mchID = mchID;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public void setHttpConnectTimeoutMs(Integer httpConnectTimeoutMs) {
        this.httpConnectTimeoutMs = httpConnectTimeoutMs;
    }

    public void setHttpReadTimeoutMs(Integer httpReadTimeoutMs) {
        this.httpReadTimeoutMs = httpReadTimeoutMs;
    }

    public void setCertStream(InputStream certStream) {
        this.certStream = certStream;
    }
    
}
